package com.seng.resourcetycoon.util;

public class DataValidator {

    public static boolean validatePlayerName(String playerName) {
        // Length check
        int length = playerName.length();
        if (length < 3 || length > 15) {
            return false;
        }

        // Character content check (no special characters)
        String pattern = "^[a-zA-Z0-9 ]*$"; // Only alphanumeric characters and spaces allowed
        return playerName.matches(pattern);

        // Name is valid
    }
}
